// This file defines the general structure of the application layout.

body {
	background: var(--background);
	color: var(--font-primary);
	overflow: hidden;
	font-family: 'Selawik', sans-serif;
}

#logo-background {
	z-index: -5;
	background: url(./images/logo.png) no-repeat center center;
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	opacity: 0.05;
}

#drop-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 500;
	font-size: 25px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: var(--background-trans);

	&-icon {
		width: 100px;
		height: 100px;
		margin-bottom: 20px;
		background-image: url(./fa-icons/copy.svg);
		background-position: center top;
		background-repeat: no-repeat;
	}
}

#container {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: grid;
	grid-template-rows: 53px 1fr 73px;

	#content {
		position: relative;
	}

	#header {
		border-bottom: 1px solid var(--border);
		background: var(--background-dark);
		z-index: 5;
		display: flex;

		#logo {
			display: flex;
			align-items: center;
			margin: 0 15px;
			background: url(./images/logo.png) no-repeat center left;
			font-size: 25px;
			font-weight: 700;
			padding: 0 0 3px 40px;
			background-size: 32px;
		}
	}
	
	#footer {
		border-top: 1px solid var(--border);
		background: var(--background-dark);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		color: var(--font-faded);
	}

	#header.shadowed {
		box-shadow: var(--widget-shadow);
	}
}

#changelog {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: grid;
	grid-template-rows: auto 1fr auto;
	padding: 10px 20px 20px 20px;

	h1 {
		margin-bottom: 10px;
	}

	pre {
		border: 1px solid var(--border);
		background: var(--background-dark);
		font-size: 20px;
		padding: 20px;
		box-shadow: rgba(0, 0, 0, 0.45) 0 0 20px 0 inset;
		overflow: auto;
	}

	input {
		margin: 20px auto;
		width: 200px;
	}
}

#blender-info {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;

	&-header {
		text-align: center;

		h1 {
			margin-bottom: 10px;
		}

		p {
			margin-bottom: 20px;
			width: 900px;
		}
	}

	&-buttons {
		display: flex;
		align-items: center;
		justify-content: center;

		input {
			margin: 0 10px;
		}
	}
}

#nav {
	display: flex;
	align-items: center;
	width: 100%;

	.option {
		margin-left: 40px;
		background-repeat: no-repeat;
		background-size: contain;
		background-position: 0 center;
		position: relative;
		
		&:hover {
			cursor: pointer;
			color: var(--font-highlight);
		}

		&.active {
			color: var(--nav-option-selected);
		}

		&::before {
			content: ' ';
			width: 25px;
			height: 100%;
			position: absolute;
			left: -30px;
			background-position: right;
			background-repeat: no-repeat;
		}
	}

	&-models::before {
		background-image: url(./fa-icons/cube.svg);
	}

	&-items::before {
		background-image: url(./fa-icons/cubes.svg);
	}

	&-textures::before {
		background-image: url(./fa-icons/image.svg);
	}

	&-sounds::before {
		background-image: url(./fa-icons/music.svg);
	}

	&-maps::before {
		background-image: url(./fa-icons/map.svg);
	}

	&-videos::before {
		background-image: url(./fa-icons/film.svg);
	}

	&-text::before {
		background-image: url(./fa-icons/file-lines.svg);
	}

	&-data::before {
		background-image: url(./fa-icons/database.svg);
	}

	&-characters::before {
		background-image: url(./fa-icons/person-solid.svg);
	}

	&-extra {
		margin-left: auto;
		width: 20px;
		height: 20px;
		background: url(./fa-icons/line-columns.svg) no-repeat;
		margin-right: 15px;
		cursor: pointer;
	}
}

#menu-extra {
	span {
		padding-left: 33px;
		background-repeat: no-repeat;
		background-position: 8px center;
		background-size: 18px;
	}

	&-blender {
		background-image: url(./images/blender.png);
	}

	&-raw {
		background-image: url(./fa-icons/fish.svg);
	}

	&-install {
		background-image: url(./fa-icons/clipboard-list.svg);
	}

	&-settings {
		background-image: url(./fa-icons/gear.svg);
	}

	&-changes {
		background-image: url(./fa-icons/list.svg);
	}

	&-restart {
		background-image: url(./fa-icons/arrow-rotate-left.svg);
	}

	&-log {
		background-image: url(./fa-icons/timeline.svg);
	}

	&-tests {
		background-image: url(./fa-icons/bug.svg);
	}

	&-style {
		background-image: url(./fa-icons/palette.svg);
	}

	&-characters {
		background-image: url(./fa-icons/bug.svg);
	}
}

#source-select {
	display: flex;
	height: 100%;
	justify-content: center;
	align-items: center;

	.source-builds {
		width: min-content;
		
		span {
			text-align: center;
			display: block;

			&:first-child {
				margin-bottom: 5px;
			}

			&:last-child {
				margin-top: 5px;
			}
		}

		p {
			margin-bottom: 10px;
		}

		input[type="button"] {
			width: 100%;
			margin: 5px 0;
		}
	}

	#source-recent {
		position: absolute;
		font-size: 15px;
		list-style: none;
		left: 50%;
		transform: translate(-50%);
		margin-top: 20px;
		
		li:not(:first-child) {
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}

	#source-cdn {
		position: absolute;
		margin-top: 20px;
		text-align: center;
		left: 0;
		right: 0;

		li {
			span {
				position: absolute;
				font-size: 12px;
				bottom: -21px;
				left: 0;
				right: 0;
			}
		}
	}

	> div {
		width: 500px;
		height: 500px;
		border: 3px dashed var(--font-faded);
		margin: 0 15px;
		border-radius: 20px;
		cursor: pointer;
		position: relative;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;

		.source-icon {
			background-position: center;
			background-repeat: no-repeat;
			width: 160px;
			height: 160px;
		}

		.source-text {
			font-size: 20px;
			margin-top: 10px;

			span {
				opacity: 0.5;
				margin-left: 2px;
			}
		}
		
		&.disabled {
			cursor: default;
		}

		&:hover, &.disabled {
			border-color: var(--font-highlight);
		}
	}

	#source-local .source-icon {
		background-image: url(./fa-icons/hard-drive.svg);
	}

	#source-remote .source-icon {
		background-image: url(./fa-icons/earth-americas.svg);
	}
}

#toast {
	position: absolute;
	left: 0;
	right: 0;
	height: 30px;
	font-size: 15px;
	display: flex;
	align-items: center;
	color: var(--font-toast);
	z-index: 1;
	padding-left: 30px;
	background-repeat: no-repeat;
	background-size: 15px;
	background-position: 10px center;

	span {
		margin: 0 5px;
		color: var(--font-toast-link);
		text-decoration: underline;
		cursor: pointer;
	}

	.close {
		margin-left: auto;
		cursor: pointer;
		background: url(./fa-icons/xmark.svg) no-repeat center;
		background-size: 10px;
		width: 30px;
		height: 100%;
	}

	&.progress {
		background-color: var(--toast-progress);
		background-image: url(./fa-icons/timer.svg);
	}

	&.info {
		background-color: var(--toast-info);
		background-image: url(./fa-icons/circle-info.svg);
	}

	&.error {
		background-color: var(--toast-error);
		background-image: url(./fa-icons/triangle-exclamation.svg);
	}

	&.success {
		background-color: var(--toast-success);
		background-image: url(./fa-icons/check.svg);
	}
}

@keyframes update-cog-spin {
	from { transform:rotate(0deg); }
	to { transform:rotate(360deg); }
}

#loading {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--background);
	z-index: 90;

	&-background {
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background: url(./images/loading.gif) no-repeat center;
		background-size: cover;
		z-index: -1;
		opacity: 0.2;

		&.xmas {
			background-image: url(./images/loading-xmas.gif);
		}
	}

	&-title {
		font-size: 25px;
	}

	&-progress {
		font-size: 20px;
	}

	&-bar {
		margin-top: 15px;
		width: 400px;
		border: 1px solid var(--border);
		height: 15px;
		background: #00000038;

		> div {
			background: var(--progress-bar);
			height: 100%;
		}
	}

	&-icon {
		margin-bottom: 10px;
		animation: update-cog-spin 6s infinite linear;
		background: url(./fa-icons/gear.svg) no-repeat center;
		width: 100px;
		height: 100px;
	}
}

#crash-screen {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 50px;
	display: flex;
	flex-direction: column;

	&-log {
		margin-top: 20px;
		height: 100%;
	}

	h1 {
		background: url(./fa-icons/triangle-exclamation-white.svg) no-repeat left center;
		padding-left: 50px;
	}

	&-text {
		font-weight: normal;
		font-size: 20px;
		margin: 20px 0;

		&-code {
			font-weight: bold;
			margin-right: 5px;
		}
	}

	&-versions span {
		margin: 0 5px;
		color: var(--border);
	}
}

input.concern {
	border-color: var(--toast-error) !important;
	color: var(--toast-error) !important;
}

p.concern {
	color: var(--toast-error);
}